package xyz.liuyuhe.StudySpring.ch10.valid;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainAppe {
    public static void main(String[] args) {
        final ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("/ch10/valid/Beans.xml");
        ControllerSimulator obj = context.getBean(ControllerSimulator.class);
        PersonForm pf = new PersonForm("liuyh", 35);
        pf.setPassword("abc");
        pf.setRepeartPassword("abc123");
        pf.setIp("127.0.0.1");
        obj.setPf(pf);
        obj.validate();
        
        System.out.println("-------------");
        obj.setAge(-1);
        
        //context.close();
    }
}
